package cn.net.mysoft.account.api.service;

import cn.net.mysoft.account.api.entity.AccountDetailEntity;
import cn.net.mysoft.account.api.exception.TransactionException;
import cn.net.mysoft.account.api.protocol.RefundInfo;
import cn.net.mysoft.account.api.protocol.TransferInfo;
import org.springframework.web.bind.annotation.*;

import java.util.List;

public interface AccountService {

    @RequestMapping(value="/createAccount/{uid}")
    int createAccount(@PathVariable(value="uid")String uid);

    @RequestMapping(value="/createControlAccount/{uid}")
    int createControlAccount(@PathVariable(value="uid")String uid);

    @RequestMapping(value="/getBalance/{uid}")
    long getBalance(@PathVariable(value="uid")String uin);

    @RequestMapping(value="/transfer")
    int transfer(@RequestBody TransferInfo itm);

    @RequestMapping(value="/reverse")
    int reverse(@RequestBody TransferInfo itm);

    @RequestMapping(value = "/refund")
    int refund(@RequestBody RefundInfo itm);

    @RequestMapping(value="/getAccountDetail/{uid}")
    List<AccountDetailEntity> getAccountDetail(@PathVariable(value="uid")String uin,
                                               @RequestParam(value="btime",required = false)String btime,
                                               @RequestParam(value="etime",required = false)String etime,
                                               @RequestParam(value="offset",defaultValue = "0")int offset,
                                               @RequestParam(value="count",defaultValue = "10")int count);
}
